// scaup - Scala up!
// (c) 2008-2010, Normen Müller, normen.mueller@gmail.com  
// $Id: digraph.scala 47 2010-01-12 20:22:35Z normen.mueller $
package scaup.data.graph

import collection._

/** A directed graph
 
 * @author <a href="mailto:normen.mueller@googlemail.com">Normen M&#xFC;ller</a>
 * @version 0.0.5 */
class DirectedGraph extends AbstractGraph {
  type Id = String  
  type V = Node
  type E = Edge
  
  case class Node(val id: Id) extends AbstractNode { self: V =>
    val incomming: mutable.Set[E] = mutable.Set.empty[E]
    
    val outgoing: mutable.Set[E] = mutable.Set.empty[E]
    
    def ->(n: V): E = Edge(this.id, this, n)
  }
  
  case class Edge(val id: Id, val source: V, val target: V) extends AbstractEdge
  
  def η(id: Id): V = Node(id)  
}

class AnnotatedDirectedGraph extends DirectedGraph with Annotations[String, String]
